<template>
	<view>
		<view class="photoList">
			<view class="photo" v-for="(item,index) in list">
				<image :src="item.picUrl" mode="scaleToFill" @click="ckimg(item.id)"></image>
			</view>
		</view>
		<image src="../../static/none.png" mode="widthFix" class="noneimg" v-if="list.length==0"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onShow() {
			this.API_user()
		},
		methods: {
			ckimg(id){
				uni.navigateTo({
					url:'/pages/public/webview?id='+id
				})
			},
			API_user(){
				var that = this;
				that.ran
					.request('/app-api/model/user-space/page', {
						pageNo:1,
						pageSize:100,
					},'POST')
					.then(res => {
						console.log(res);
						if (res.code == 200) {
							that.list = res.data.list;
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none'
							});
						}
					});
			},
		}
	}
</script>

<style lang="scss">
	.noneimg{
		width: 300rpx;
		margin: 100rpx auto;
		display: block;
	}
	.photoList {
		margin-left: 20rpx;
		overflow: hidden;
		margin-top: 50rpx;

		.photo {
			width: 213rpx;
			height: 213rpx;
			margin-left: 20rpx;
			overflow: hidden;
			float: left;
			border-radius: 10rpx;
			margin-bottom: 20rpx;

			image {
				width: 213rpx;
				height: 213rpx;
				display: block;
				// width: 100%;
			}
		}
	}
</style>